<template>
    <Card>
        <template v-slot:header>
            <h3>欢迎注册</h3>
        </template>
        <CardForm text="注册" @click="register" ></CardForm>
        <template v-slot:footer>
            <router-link to="/login" class="text-muted">如果已经注册，请点击此处登录</router-link>
        </template>
    </Card>
</template>

<script>
import Card from "../components/Card";
import CardForm from "../components/CardForm";
export default {
    name:'Register',
    components:{
        Card,
        CardForm
    },
   
    methods:{
        register(username, password) {
            const user={}
        this.$store.state.user=user
            user.username = username
            user.password = password
             console.log(username)
             console.log(password)
            console.log("注册成功")
          this.$router.push({path:'/login'})
        },
    }
}
</script>